home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 October / CHIP Turkiye Ekim 2000.iso / prog / naps / 04 / setup.exe / Gnucleus / Base64.h < prev    next >
C/C++ Source or Header  |  2000-06-24  |  1KB  |  41 lines

  1. // Base64.h: interface for the CBase64 class.
  2. // Author: Wes Clyburn (clyburnw@enmu.edu)
  3. // Modified and adapted by: Nathan Brown (shiften@dittosrush.com)
  4. //////////////////////////////////////////////////////////////////////
  5.  
  6. #if !defined(AFX_BASE64_H__FD6A25D1_EE0E_11D1_870E_444553540001__INCLUDED_)
  7. #define AFX_BASE64_H__FD6A25D1_EE0E_11D1_870E_444553540001__INCLUDED_
  8.  
  9. #if _MSC_VER >= 1000
  10. #pragma once
  11. #endif // _MSC_VER >= 1000
  12.  
  13. // CBase64
  14. // An encoding agent that handles Base64
  15. //
  16. class CBase64
  17. {
  18. public:
  19.     CBase64();
  20.     virtual ~CBase64();
  21.  
  22. // Override the base class mandatory functions
  23.     virtual int Decode( LPCTSTR szDecoding, LPTSTR szOutput );
  24.     virtual CString Encode( LPCTSTR szEncoding, int nSize );
  25.  
  26. protected:
  27.     void write_bits( UINT nBits, int nNumBts, LPTSTR szOutput, int& lp );
  28.     UINT read_bits( int nNumBits, int* pBitsRead, int& lp );
  29.  
  30.     int m_nInputSize;
  31.     int m_nBitsRemaining;
  32.     ULONG m_lBitStorage;
  33.     LPCTSTR m_szInput;
  34.  
  35.     static int m_nMask[];
  36.     static CString m_sBase64Alphabet;
  37. private:
  38. };
  39.  
  40. #endif // !defined(AFX_BASE64_H__FD6A25D1_EE0E_11D1_870E_444553540001__INCLUDED_)
  41.